/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.clooud.modulos.eventos.controller;

import com.clooud.modulos.eventos.model.EventoModel;
import com.clooud.util.pmf.PMF;
import com.google.appengine.api.datastore.Key;
import javax.jdo.PersistenceManager;

/**
 *
 * @author selvino
 */
public class EventoController {

    public static EventoModel createEvento() {
        return new EventoModel();
    }

    public static EventoModel getEventoFromKey(Key eventoKey) {
        PersistenceManager pm = PMF.getPersistenceManager();
        try {
            Object eventoObj = pm.getObjectById(EventoModel.class, eventoKey.getId());
            return (EventoModel) eventoObj;
        } finally {
            pm.close();
        }
    }

}
